#include "24c02.h"
#include "IIC.h"
void at24c02_write_one_byte(unsigned char addr,unsigned char dat)
{
	IIC_start();
	IIC_write_byte(0xa0);
	IIC_wait_ack();
	IIC_write_byte(addr);
	IIC_wait_ack();
	IIC_write_byte(dat);
	IIC_wait_ack();
	IIC_stop();
	delay_ms(10);
}
unsigned char at24c02_read_one_byte(unsigned char addr) 
{
	unsigned char temp = 0;
	IIC_start();
	IIC_write_byte(0xa0);
	IIC_wait_ack();
	IIC_write_byte(addr);
	IIC_wait_ack();
	IIC_start();
	IIC_write_byte(0xa1);
	IIC_wait_ack();
   	temp = IIC_read_byte(0);
	IIC_stop();
	return temp;
}